package com.mlog.njyjy.ndop.share.sql.annotation;

import java.lang.annotation.*;

/**
 * <p>
 * TODO
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/7/8
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Table {

    /**
     * table name if empty
     * use {@link com.mlog.njyjy.ndop.share.sql.support.SqlTableUtil#getTblName(Class)}
     *
     * @return
     */
    String name() default "";

    /**
     * prefix of table's name
     *
     * @return
     */
    String prefix() default "";

    /**
     * 唯一性约束
     * eg unique key `unique_col1_col2` (`col1`,`col2`)
     *
     * @return
     */
    TableUnique[] uniques() default {};

    /**
     * 表索引
     *
     * @return
     * @see TableIndex
     */
    TableIndex[] indexes() default {};

    /**
     * comment of table
     *
     * @return
     */
    String comment() default "";
}
